<?php

/**
 * Flickr Photosets - Library
 * This file should be included from every page. It includes all necessary files for the app.
 * 
 * @author Brad Dougherty <bdougherty@gmail.com>
 * @version 2.0
 * @license http://www.gnu.org/licenses/gpl.html GNU General Public License 3.0
 */

/*
Change this to bring the app down.
*/
define('APP_DOWN', false);

/*
Include the database connection information
Defines constants DB_HOST, DB_USER, DB_PASS, DB_NAME
*/
require_once 'config/db.php';

/*
Include the API information
Defines constants FACEBOOK_API_KEY, FACEBOOK_API_SECRET, FLICKR_API_KEY,
FLICKR_API_SECRET, GOOGLEMAPS_API_KEY, GOOGLE_ANALYTICS_ACCOUNT
*/
require_once 'config/api.php';

/*
Include the app configuration
Defines constants APP_NAME, APP_URL, APP_CALL_URL, CACHE_DIR
*/
require_once 'config/env.php';

// Include the Facebook client library
require_once 'client/facebook.php';

// Include the phpFlickr library
require_once 'phpFlickr/phpFlickr.php';

/**
 * Autoload the classes as needed, all are located in classes subdir
 * @param string $class_name The class to load
 */
function __autoload($class_name) {
	require_once './classes/'.$class_name.'.php';
}

/*
Turn on error reporting
You can either change this variable to true or append ?showerrors to the url.
*/
$error_reporting = false;
if (isset($_GET['showerrors']) or $error_reporting) {
	error_reporting(E_ALL);
	ini_set('display_errors', 1);
}

?>